import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
const Login = () => import('../components/Login.vue')
const DashBoard = () => import('../components/home/Dashboard.vue')
const UserList = () => import('../components/home/userList.vue')
const UserDetail = () => import('../components/home/userDetail.vue')
const UserEdit = () => import('../components/home/userEdit.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    component: DashBoard,
    redirect: '/dashboard/userList',
    children: [
      {
        path: 'userList',
        name: 'userList',
        component: UserList
      },
      {
        path: 'userDetail',
        name: 'userDetail',
        component: UserDetail
      },
      {
        path: 'userEdit',
        name: 'userEdit',
        component: UserEdit
      }
    ]
  },
  {
    path: '/login',
    component: Login

  }
]

const router = new VueRouter({
  routes
})

export default router
